package com.project.logistics.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.logistics.bean.Repairman;
import com.project.logistics.bean.Repairs;
import com.project.logistics.mapper.RepairmanMapper;
import com.project.logistics.service.RepairmanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by94988 on 2021/3/19 18:22
 */
@Service
public class RepairmanServiceImpl  extends ServiceImpl<RepairmanMapper, Repairman> implements RepairmanService {

    @Autowired
    RepairmanMapper repairmanMapper;
    @Override
    public boolean deleteById(String userId) {
        return repairmanMapper.deleteById2(userId);
    }

    @Override
    public Repairman findRepairmanById(String id) {
        return repairmanMapper.findRepairmanById(id);
    }

    @Override
    public int updateRepairman(Repairman repairman) {
        return repairmanMapper.updateRepairman(repairman);
    }

    @Override
    public int setCount(String repairmanId) {
        Repairman repairman = repairmanMapper.findRepairmanById(repairmanId);
        return repairmanMapper.setCount(repairman.getRepairCount()+1,repairmanId);
    }
    @Override
    public Repairman getRepairmanByUserId(String userId) {
        return repairmanMapper.getRepairmanByUserId(userId);
    }

    @Override
    public Repairman getTodayRepairman() {
        return repairmanMapper.getTodayRepairman();
    }

    @Override
    public int deleteTodayRepairman(String userId) {
        return repairmanMapper.deleteTodayRepairman(userId);
    }

    @Override
    public int updateTodayRepairman(String userId) {
        return repairmanMapper.updateTodayRepairman(userId);
    }


}
